home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / Technocop.lha / TechnocopHD / Install next >
Text File  |  2002-08-07  |  8KB  |  298 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #man-file "Manual")        ;name of manual file
  6. (set #hint-file "Hints")        ;name of hint file
  7. (set #sol-file "Solution")        ;name of solution file
  8. (set #highs-file "highs")        ;name of high scores file
  9. (set #prefix @app-name)                 ;name of slave, directory
  10.  
  11. (procedure P_Install
  12.       (set #AD_disk "Technocop")
  13.       (P_disk)
  14.       (copyfiles
  15.         (help @copyfiles-help)
  16.         (source ("%s:" #AD_disk))
  17.         (dest #dest)
  18.         (files)
  19.         (pattern "~(        )")
  20.       )
  21. )
  22.  
  23. ;****************************
  24. ;----------------------------
  25. ; checks if given program is installed, if not abort install
  26. ; #program - to check
  27.  
  28. (procedure P_ChkRun
  29.   (if
  30.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  31.     ("")
  32.     (abort
  33.       (cat
  34.     "You must install \"" #program "\" first!\n"
  35.     "It must be accessible via the path.\n"
  36.     "You can find it in the WHDLoad package."
  37.       )
  38.     )
  39.   )
  40. )
  41.  
  42. ;----------------------------
  43. ; Wait for inserting disk
  44. ; IN:  #AD_disk - name of disk
  45. ; OUT: -
  46.  
  47. (procedure P_disk
  48.   (askdisk
  49.     (dest #AD_disk)
  50.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  51.     (help @askdisk-help)
  52.   )
  53. )
  54.  
  55. ;----------------------------
  56. ; copy file including icon if exist
  57. ; #copy-file - name of file to copy
  58.  
  59. (procedure P_CopyFile
  60.   (if
  61.     (exists #copy-file)
  62.     (
  63.       (copyfiles
  64.         (help @copyfiles-help)
  65.         (source #copy-file)
  66.         (dest #dest)
  67.       )
  68.       (if
  69.         (exists ("%s.info" #copy-file))
  70.         (
  71.           (copyfiles
  72.             (help @copyfiles-help)
  73.             (source ("%s.info" #copy-file))
  74.             (dest #dest)
  75.           )
  76.           (tooltype
  77.             (dest (tackon #dest #copy-file))
  78.             (noposition)
  79.           )
  80.         )
  81.       )
  82.     )
  83.   )
  84. )
  85.  
  86. ;****************************
  87.  
  88.  
  89. (if
  90.   (< @installer-version (+ (* 44 65536) 10))
  91.   (
  92.   (message
  93.     (cat
  94.       "Warning: your installer is outdated.\n"
  95.       "All features of this installation won't be available, such as icon show and drawer opening.\n"
  96.       "You have version " (/ @installer-version 65536) "." 
  97.       (BITAND @installer-version 65535) ", needed is at least version 44.10. "
  98.       "The 'installer' 44.10 comes with OS 3.5 but is also contained in the NDK 3.9. "
  99.       "You may also use the InstallerNG by Jens Tröger."
  100.       "\n\n"
  101.       "The installers can be obtained from the net:\n"
  102.       "http://www.amiga.com/3.9/download/NDK3.9.lha\n"
  103.       "aminet:util/sys/InstallerNG.lha"
  104.     )
  105.   )
  106.   (set #newstuff 0)
  107.   )
  108.   (set #newstuff 1)
  109. )
  110.  
  111. (if
  112.   (exists #readme-file)
  113.   (if
  114.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  115.     ("")
  116.     (run ("SYS:Utilities/More %s" #readme-file))
  117.   )
  118. )
  119.  
  120. (set #program "WHDLoad")
  121. (P_ChkRun)
  122.  
  123. (if
  124.   (getenv "WHDLInstPath")
  125.   (set @default-dest (getenv "WHDLInstPath"))
  126. )
  127. (set #dest
  128.   (askdir
  129.     (prompt
  130.       (cat
  131.     "Where should \"" @app-name "\" be installed?\n"
  132.     "A drawer \"" #prefix "\" will be automatically created."
  133.       )
  134.     )
  135.     (help @askdir-help)
  136.     (default @default-dest)
  137.   )
  138. )
  139. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
  140. (set @default-dest #dest)
  141. (set #dest (tackon #dest #prefix))
  142. (if
  143.   (exists #dest)
  144.   (
  145.     (set #choice
  146.       (askbool
  147.         (prompt
  148.           (cat
  149.             "\nDirectory \"" #dest "\" already exists.\n"
  150.             "Should it be deleted?"
  151.           )
  152.         )
  153.         (default 1)
  154.         (choices "Delete" "Skip")
  155.         (help @askbool-help)
  156.       )
  157.     )
  158.     (if
  159.       (= #choice 1)
  160.       (delete #dest
  161.         (help @delete-help)
  162.         (all)
  163.       )
  164.     )
  165.   )
  166. )
  167. (makedir #dest
  168.   (help @makedir-help)
  169.   (infos)
  170. )
  171.  
  172. ;----------------------------
  173.  
  174. (copyfiles
  175.   (help @copyfiles-help)
  176.   (source ("%s.Slave" #prefix))
  177.   (dest #dest)
  178. )
  179. (if (exists ("%s.glowexot"  #prefix)) ((set #icon 7)(set #icnt (+ 1 #icnt))(set #icon-gex "Exotic GlowIcon")) (set #icon-gex ""))
  180. (if (exists ("%s.newexot"   #prefix)) ((set #icon 6)(set #icnt (+ 1 #icnt))(set #icon-nex "Exotic NewIcon"))  (set #icon-nex ""))
  181. (if (exists ("%s.exoticon"  #prefix)) ((set #icon 5)(set #icnt (+ 1 #icnt))(set #icon-exo "Exoticon"))        (set #icon-exo ""))
  182. (if (exists ("%s.glowicon"  #prefix)) ((set #icon 4)(set #icnt (+ 1 #icnt))(set #icon-glo "Glow Icon"))       (set #icon-glo ""))
  183. (if (exists ("%s.coloricon" #prefix)) ((set #icon 3)(set #icnt (+ 1 #icnt))(set #icon-col "OS3.5 Icon"))      (set #icon-col ""))
  184. (if (exists ("%s.newicon"   #prefix)) ((set #icon 2)(set #icnt (+ 1 #icnt))(set #icon-new "NewIcon"))         (set #icon-new ""))
  185. (if (exists ("%s.romicon"   #prefix)) ((set #icon 1)(set #icnt (+ 1 #icnt))(set #icon-rom "RomIcon"))         (set #icon-rom ""))
  186. (if (exists ("%s.inf"       #prefix)) ((set #icon 0)(set #icnt (+ 1 #icnt))(set #icon-nor "Normal"))          (set #icon-nor ""))
  187. (procedure P_Icon
  188.   (copyfiles
  189.     (help @copyfiles-help)
  190.     (source ("%s.%s" #prefix #icon-suf))
  191.     (newname ("%s.info" #icon-name))
  192.     (dest #icon-dir)
  193.   )
  194.   (tooltype
  195.     (dest (tackon #icon-dir #icon-name))
  196.     (noposition)
  197.   )
  198. )
  199. (if
  200.   (> #icnt 1)
  201.   (
  202.     (set #icon-dir ("T:%s Icons" #prefix))
  203.     (makedir #icon-dir
  204.       (help @makedir-help)
  205.     )
  206.     (if #icon-nor ((set #icon-suf "inf")      (set #icon-name "Normal")          (P_Icon)))
  207.     (if #icon-rom ((set #icon-suf "romicon")  (set #icon-name "RomIcon")         (P_Icon)))
  208.     (if #icon-new ((set #icon-suf "newicon")  (set #icon-name "NewIcon")         (P_Icon)))
  209.     (if #icon-col ((set #icon-suf "coloricon")(set #icon-name "OS3.5 Icon")      (P_Icon)))
  210.     (if #icon-glo ((set #icon-suf "glowicon") (set #icon-name "Glow Icon")       (P_Icon)))
  211.     (if #icon-exo ((set #icon-suf "exoticon") (set #icon-name "Exoticon")        (P_Icon)))
  212.     (if #icon-nex ((set #icon-suf "newexot")  (set #icon-name "Exotic NewIcon")  (P_Icon)))
  213.     (if #icon-gex ((set #icon-suf "glowexot") (set #icon-name "Exotic GlowIcon") (P_Icon)))
  214. (if (= #newstuff 1)
  215.     (openwbobject #icon-dir)
  216. )
  217.     (set #icon
  218.       (askchoice
  219.         (prompt "\nWhich icon would you like to install?\n")
  220.         (choices #icon-nor #icon-rom #icon-new #icon-col #icon-glo #icon-exo #icon-nex #icon-gex)
  221.         (default #icon)
  222.         (help @askchoice-help)
  223.       )
  224.     )
  225.    (if (= #newstuff 1)
  226.      (closewbobject #icon-dir)
  227.    )
  228.     (delete #icon-dir
  229.       (help @delete-help)
  230.       (all)
  231.     )
  232.   )
  233. )
  234. (select #icon
  235.   (set #icon "inf")
  236.   (set #icon "romicon")
  237.   (set #icon "newicon")
  238.   (set #icon "coloricon")
  239.   (set #icon "glowicon")
  240.   (set #icon "exoticon")
  241.   (set #icon "newexot")
  242.   (set #icon "glowexot")
  243. )
  244. (copyfiles
  245.   (help @copyfiles-help)
  246.   (source ("%s.%s" #prefix #icon))
  247.   (newname ("%s.info" #prefix))
  248.   (dest #dest)
  249. )
  250. (if
  251.   (= #icon "newicon")
  252.   ("")
  253.   (
  254.     (tooltype
  255.       (dest (tackon #dest #prefix))
  256.       (settooltype "Slave")
  257.       (settooltype "PreLoad")
  258.     )
  259.     (tooltype
  260.       (dest (tackon #dest #prefix))
  261.       (settooltype "PreLoad" "")
  262.       (settooltype "Slave" ("%s.Slave" #prefix))
  263.     )
  264.   )
  265. )
  266. (tooltype
  267.   (dest (tackon #dest #prefix))
  268.   (setdefaulttool "WHDLoad")
  269.   (setstack 10240)
  270.   (noposition)
  271. )
  272. (set #copy-file #readme-file)
  273. (P_CopyFile)
  274. (set #copy-file #man-file)
  275. (P_CopyFile)
  276. (set #copy-file #hint-file)
  277. (P_CopyFile)
  278. (set #copy-file #sol-file)
  279. (P_CopyFile)
  280. (set #dest-org #dest)
  281. (if
  282.   (= #sub-dir "")
  283.   ("")
  284.   (
  285.     (set #dest (tackon #dest #sub-dir))
  286.     (makedir #dest
  287.       (help @makedir-help)
  288.     )
  289.   )
  290. )
  291. (set #copy-file #highs-file)
  292. (P_CopyFile)
  293. (P_Install)
  294. (if (= #newstuff 1)
  295.    (openwbobject #dest-org)
  296. )
  297. (exit)
  298.